
package cn.nubia.admin.application.bean;

import cn.nubia.admin.common.mybatis.annotations.Id;
import cn.nubia.admin.common.mybatis.annotations.Table;
import cn.nubia.admin.common.mybatis.annotations.UnColumn;
import cn.nubia.admin.common.utils.DateUtil;

import java.io.Serializable;

/**
 * Created by justin on 15/6/30.
 * CREATE TABLE `nb_ad_space` (
 `ad_space_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '广告位id',
 `ad_space_name` varchar(50) DEFAULT NULL COMMENT '广告位名称',
 `create_time` int(11) DEFAULT NULL COMMENT '创建时间',
 `sort_index` int(11) DEFAULT NULL COMMENT '排序号',
 `state` smallint(6) DEFAULT NULL COMMENT '状态（-1-删除 0-隐藏 1-显示）',
 `terminal_id` int(11) DEFAULT NULL COMMENT '展示端id',
 `pic_width` int(11) DEFAULT NULL COMMENT '广告图片宽度',
 `pic_height` int(11) DEFAULT NULL COMMENT '广告图片高度',
 `ad_limit` int(11) DEFAULT NULL COMMENT '广告个数限制',
 `create_admin_id` int(11) DEFAULT NULL COMMENT '创建人的管理员id',
 `create_admin_name` varchar(20) DEFAULT NULL COMMENT '创建人的管理员名称',
 `modify_admin_id` int(11) DEFAULT NULL COMMENT '修改人的管理员id',
 `modify_admin_name` varchar(20) DEFAULT NULL COMMENT '修改人的管理员名称',
 `last_modify_time` int(11) DEFAULT NULL COMMENT '最后修改时间',
 PRIMARY KEY (`ad_space_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='广告位';
 */
//广告位字段.
@Table(value = "nb_ad_space")
public class AdSpace implements Serializable{

    private static final long serialVersionUID = -8244661101951482489L;
    public static final Integer DELETE_STATE = -1;

    public static final int STATE_DEL = -1;
    public static final int STATE_HIDDEN =0;
    public static final int STATE_SHOW = 1;

    public static final String COLUMN_STATE = "state";

    @Id(value = "ad_space_id")
    private Integer id;
    private String adSpaceName;//广告位名称
    private Integer createTime;
    private Integer sortIndex;
    private Integer state;//状态（-1-删除 0-隐藏 1-显示）
    private Integer terminalId;//展示端id
    private Integer picWidth;//广告图片宽度
    private Integer picHeight;//广告图片高度
    private Integer adLimit;//广告个数限制
    private Integer createAdminId;
    private String createAdminName;//创建人的管理员名称
    private Integer modifyAdminId;//修改人的管理员id
    private String modifyAdminName;//修改人的管理员名称
    private Integer lastModifyTime;//最后修改时间
    private Integer spaceShowType;
    @UnColumn
    private String createTimeShow;


    public void copyStakeProperties(AdSpace domain) {
        this.setCreateAdminName(domain.getCreateAdminName());
        this.setCreateAdminId(domain.getCreateAdminId());
        this.setCreateTime(domain.getCreateTime());
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAdSpaceName() {
        return adSpaceName;
    }

    public void setAdSpaceName(String adSpaceName) {
        this.adSpaceName = adSpaceName;
    }


    public Integer getSortIndex() {
        return sortIndex;
    }

    public void setSortIndex(Integer sortIndex) {
        this.sortIndex = sortIndex;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getTerminalId() {
        return terminalId;
    }

    public void setTerminalId(Integer terminalId) {
        this.terminalId = terminalId;
    }

    public Integer getPicWidth() {
        return picWidth;
    }

    public void setPicWidth(Integer picWidth) {
        this.picWidth = picWidth;
    }

    public Integer getPicHeight() {
        return picHeight;
    }

    public void setPicHeight(Integer picHeight) {
        this.picHeight = picHeight;
    }

    public Integer getAdLimit() {
        return adLimit;
    }

    public void setAdLimit(Integer adLimit) {
        this.adLimit = adLimit;
    }

    public String getCreateAdminName() {
        return createAdminName;
    }

    public void setCreateAdminName(String createAdminName) {
        this.createAdminName = createAdminName;
    }

    public Integer getModifyAdminId() {
        return modifyAdminId;
    }

    public void setModifyAdminId(Integer modifyAdminId) {
        this.modifyAdminId = modifyAdminId;
    }

    public String getModifyAdminName() {
        return modifyAdminName;
    }

    public void setModifyAdminName(String modifyAdminName) {
        this.modifyAdminName = modifyAdminName;
    }

    public Integer getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Integer createTime) {
        this.createTime = createTime;
        if(createTime!=null && !"".equals(createTime)){
            this.createTimeShow = DateUtil.getFormatDate(createTime);
        }
    }

    public Integer getLastModifyTime() {
        return lastModifyTime;
    }

    public void setLastModifyTime(Integer lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    public Integer getCreateAdminId() {
        return createAdminId;
    }

    public void setCreateAdminId(Integer createAdminId) {
        this.createAdminId = createAdminId;
    }

    public String getCreateTimeShow() {
        return createTimeShow;
    }

    public void setCreateTimeShow(String createTimeShow) {
        this.createTimeShow = createTimeShow;
    }


    public Integer getSpaceShowType() {
        return spaceShowType;
    }

    public void setSpaceShowType(Integer spaceShowType) {
        this.spaceShowType = spaceShowType;
    }
}
